package dto

// PermissionLogQueryParams 权限日志查询参数
type PermissionLogQueryParams struct {
	Page           int    `form:"page" binding:"required,min=1"`
	PageSize       int    `form:"pageSize" binding:"required,min=1,max=100"`
	UserID         *uint  `form:"userId"`
	Username       string `form:"username"`
	ActionType     string `form:"actionType"` // ACCESS, CHANGE, DENY
	PermissionCode string `form:"permissionCode"`
	Module         string `form:"module"`
	Result         *int8  `form:"result"` // 0-拒绝, 1-通过
	StartTime      string `form:"startTime"`
	EndTime        string `form:"endTime"`
}

// ClearCacheRequest 清除缓存请求
type ClearCacheRequest struct {
	UserIDs []uint `json:"userIds"` // 用户ID列表，为空则清除所有
	Type    string `json:"type"`    // 缓存类型: user, role, all
}

// PermissionCheckRequest 权限检查请求
type PermissionCheckRequest struct {
	UserID         uint   `json:"userId" binding:"required"`
	PermissionCode string `json:"permissionCode" binding:"required"`
}

// PermissionCheckResponse 权限检查响应
type PermissionCheckResponse struct {
	HasPermission bool   `json:"hasPermission"`
	Reason        string `json:"reason,omitempty"`
}
